home *** CD-ROM | disk | FTP | other *** search
/ HAM Radio 1997 / HAM Radio 1997.iso / vcls / wfc007.000 / test / test.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-08  |  2.0 KB  |  79 lines

  1. #include "test.h"
  2. #pragma hdrstop
  3.  
  4. /*
  5. ** Author: Samuel R. Blackburn
  6. ** CI$: 76300,326
  7. ** Internet: sammy@sed.csc.com
  8. **
  9. ** You can use it any way you like.
  10. */
  11.  
  12. int main()
  13. {
  14. //   memory();
  15. //   test_CRegistry();
  16. //   test_CRAS();
  17. //   test_CEventLog();
  18.    test_CLZFile( "b:\\ctl3d32.dl_" );
  19. //   test_CServer( "sammy" );
  20. //   test_CServer( "sammy" );
  21. //   test_CServer( "\\\\SAMMY" );
  22. //   test_CNetSession( NULL );
  23. //   test_CNetResource();
  24. //   test_CNetWorkstation( "ftp" );
  25. //   test_CNetworkFiles( "ftp" );
  26. //   test_CNetworkConnections( "ftp" );
  27. //   test_CUniformResourceLocator();
  28.  
  29.    return( EXIT_SUCCESS );
  30. }
  31.  
  32. LPTSTR BigNumToString( LONG lNum, LPTSTR szBuf )
  33. {
  34.    WORD wNumDigits = 0, wNumChars = 0;
  35.  
  36.    do
  37.    {
  38.       szBuf[ wNumChars++ ] = lNum % 10 + __TEXT( '0' );
  39.       wNumDigits++;
  40.       
  41.       if ( ( wNumDigits % 3 ) == 0 )
  42.       {
  43.          szBuf[ wNumChars++ ] = __TEXT( ',' );
  44.       }
  45.  
  46.       lNum /= 10;
  47.    }
  48.    while( lNum != 0 );
  49.  
  50.    if ( szBuf[ wNumChars - 1 ] == __TEXT( ',' ) )
  51.    {
  52.       szBuf[ wNumChars - 1 ] = 0x00;
  53.    }
  54.  
  55.    szBuf[ wNumChars ] = 0x00;
  56.  
  57.    _strrev( szBuf );
  58.    
  59.    return( szBuf );
  60. }
  61.  
  62. void memory( void )
  63. {
  64.    TCHAR szBuf[ 50 ];
  65.  
  66.    CMemoryStatus memory_status;
  67.  
  68.    GlobalMemoryStatus( &memory_status );
  69.  
  70.    TRACE1( "Memory Load:         %-20s\n", BigNumToString( memory_status.dwMemoryLoad,    szBuf ) );
  71.    TRACE1( "Total Physical:      %-20s\n", BigNumToString( memory_status.dwTotalPhys,     szBuf ) );
  72.    TRACE1( "Available Physical:  %-20s\n", BigNumToString( memory_status.dwAvailPhys,     szBuf ) );
  73.    TRACE1( "Total Page File:     %-20s\n", BigNumToString( memory_status.dwTotalPageFile, szBuf ) );
  74.    TRACE1( "Available Page File: %-20s\n", BigNumToString( memory_status.dwAvailPageFile, szBuf ) );
  75.    TRACE1( "Total Virtual:       %-20s\n", BigNumToString( memory_status.dwTotalVirtual,  szBuf ) );
  76.    TRACE1( "Available Virtual:   %-20s\n", BigNumToString( memory_status.dwAvailVirtual,  szBuf ) );
  77. }
  78.  
  79.